%{
int yylex();
void yyerror(const char *s);
%}

%token PCT_ADD PCT_SUB PCT_MULT PCT_DIV
%token INT FLOAT
%token ID

%%

value_gen
    : INT
    | FLOAT
    | function
    ;
expression
    : value_gen
    | value_gen op value_gen
    | '(' expression ')'
    ;

op
    : PCT_ADD
    | PCT_SUB
    | PCT_MULT
    | PCT_DIV
    ;

function_args
    : expression
    | function_args ',' expression
    ;

function
    : ID '(' function_args ')'
    ;

%% 

#include <stdio.h>

extern char yytext[];
extern int column;

 void yyerror (char const *s) {
   fprintf (stderr, "%s\n", s);
 }
